package com.example.baijiebrower.tools;

import android.app.Activity;
import android.content.pm.PackageManager;

import androidx.core.app.ActivityCompat;

public class Permissions {
    public static void checkPermission(Activity activity , String[] permission){
        String[] noPermission = new String[permission.length];
        int j = 0 ;
        for (int i = 0; i < permission.length; i++) {
            if (activity.checkSelfPermission(permission[i]) == PackageManager.PERMISSION_DENIED){
                if (permission[i] != null){
                    requestPermisson(new String[]{permission[i]} ,  activity );
                }
            }
        }
    }
    private static void requestPermisson(String[] s , Activity activity) {

        ActivityCompat.requestPermissions(activity , s  , 100);
    }
}
